<?php

if(STAINLESS != 1){
	require_once('../config.php');
	redirect("$home_url/admin/login");
}

	if($router == 'products'){
		$title = 'Quản lý danh sách các sản phẩm';
	/* }elseif($router == 'questions'){
		$title = "Quản lý ngân hàng câu hỏi";
	}elseif($router == 'answers'){
		$title = "Quản lý ngân hàng câu trả lời"; */
	}else{
		$title = 'Đăng nhập';
	}
	
	$username = isset($_SESSION['username']) ? $_SESSION['username'] : '';
?>
<!doctype html>
<html>
<head>
	<title><?php echo $title; ?></title>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<link href="<?php echo $home_url; ?>/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<link rel="stylesheet" href="<?php echo $home_url; ?>/css/animate.css" />
	<link rel="stylesheet" href="<?php echo $home_url; ?>/bootstrap/css/bootstrap.min.css" />
	<link rel="stylesheet" href="<?php echo $home_url; ?>/bootstrap/css/bootstrap-theme.min.css" />
	<link rel="stylesheet" href="<?php echo $home_url; ?>/css/general.css" />
	<link rel="stylesheet" href="<?php echo $home_url; ?>/css/admin.css" />
</head>
<body>
<?php if(!empty($username)){ ?>
<nav id="navigation" class="navbar navbar-default">
	<div class="container-fluid">
		<div id="logo" class="navbar-header">
			<a class="nav-brand" href="<?php echo $home_url; ?>/admin/">STYLE AND DESIRE</a>
		</div>
		<div id="main-menu">
			<ul class="nav navbar-nav">
				<li <?php if($router == 'products') echo "class='active'" ?>><a href="<?php echo $home_url; ?>/admin/products/">Áo thun</a></li>
				<li class="<?php if($router == 'huong-dan-choi-game') echo "active " ?>dropdown" style="display:none">
					<a class="dropdown-toggle" data-toggle="dropdown" href="#">HƯỚNG DẪN CHƠI GAME<span class="caret"></span></a>
				  <ul class="dropdown-menu" style="width:200px">
					<li><a href="<?php echo $home_url; ?>/huong-dan-choi-game/">Cặp đôi hoàn hảo</a></li>
					<li><a href="#">Ai là triệu phú</a></li>
				  </ul>
				</li>
			</ul>
			<div class="pull-right navbar-header">
				<div class="navbar-brand">
					<span>Xin chào <?php echo $username; ?></span>
					<a id="change_password" href="<?php echo $home_url; ?>/admin/change-password/" title="Đổi mật khẩu">
						<span class="fa fa-lock fa-2x fa-fw"></span>
					</a>
					<a id="logout" href="<?php echo $home_url; ?>/admin/logout" title="Thoát">
						<span class="fa fa-sign-out fa-2x fa-fw"></span>
					</a>
				</div>
			</div>
		</div>
	</div>
</nav>
<?php } ?>